<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1 minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta content="telephone=no" name="format-detection" />
    <meta name="apple-mobile-web-app-capable" content="no"/>
    <meta http-equiv='x-dns-prefetch-control' content='on'>

    <title>提现</title>
    <link rel="stylesheet" type="text/css" href="@{'/public/stylesheets/mobile/mobile.css'}"/>
    <link rel="stylesheet" type="text/css" href="@{'/public/stylesheets/reset.css'}"/>
    <link rel="stylesheet" type="text/css" href="@{'/public/stylesheets/mobile/jquery.mobile.theme-1.4.3.css'}"/>
    <link rel="stylesheet" type="text/css" href="@{'/public/stylesheets/mobile/jquery.mobile-1.4.3.css'}"/>
    <link rel="stylesheet" type="text/css" href="@{'/public/stylesheets/mobile/enchash.css'}"/>

    <script type="text/javascript" src="@{'/public/javascripts/mobileCommon.js'}"></script>
    <script type="text/javascript" src="@{'/public/javascripts/verification.js'}"></script>
    <script type="text/javascript" src="@{'/public/javascripts/jquery-2.0.js'}"></script>
    <script type="text/javascript" src="@{'/public/javascripts/share/jweixin-1.0.0.min.js'}"></script>
    <script type="text/javascript" src="@{'/public/javascripts/share/sha.js'}"></script>
    <script type="text/javascript" src="@{'/public/javascripts/share/sign.js'}"></script>
    <script type="text/javascript" src="@{'/public/javascripts/share/weixin.js'}"></script>
    <script type="text/javascript" src="@{'/public/javascripts/share/defaultshare.js'}"></script>
    <script type="text/javascript" src="@{'/public/javascripts/jquery.mobile-1.4.3.js'}"></script>
</head>
<body>
    <div data-role="page" id="enchash">
        <form method="post" id="submit" data-ajax="false" action="/mobile/account/enchashConfirm">
            <div class="bill-detail-middle">
                <div>
                    可提现金额：<span class="prod-name">${paramsJson?.balance?.format('###,##0.00')}</span>元
                </div>

                <div class="input-container" data-role="none">
                    <span>输入提现金额：</span><input data-role="none" type="text" name="money" id="money" placeholder="输入金额" value="${paramsJson?.money}"/>
                </div>

                <div id="day_tips_show">提示：直接充值款项须<span id="withdrawal_day"></span>个工作日方可申请提现！</div>
            </div>
            <div class="btn-container" >
                <a id="confirmRechargeBtn" href="#" class="ui-btn ui-corner-all" onclick="enchashConfirm();">进入汇付页面</a>
            </div>
        </form>

        <div class="oa_er_bk">
            <div class="oa_error">
                <h3>错误提示</h3>
                <p class="error_content" id="error_content"></p>
                <button data-role="button" id="close" class="os_cf" onclick="closeErrorTips();">确定</button>
            </div>
        </div>

    </div>
</body>
</html>

<script>
    $(document).ready(function(){
        var day = '${paramsJson?.withdrawal_day}';
        if (day != null && Number(day) > 0) {
            $("#day_tips_show").show();
            $("#withdrawal_day").text(day);
        }else{
            $("#day_tips_show").hide();
        }

        var error = '${flash?.error}';
        if (error == null || error == undefined || error == '') {
            $(".oa_er_bk").hide();
        }else{
            $(".oa_er_bk").show();
            $("#error_content").text(error);
        }
    });

    function enchashConfirm(){
        var money = $("#money").val();
        var enchaseMoney = veriMoney(money, -1, '${paramsJson?.balance}');
        if (enchaseMoney != true) {
            $(".oa_er_bk").show();
            $("#error_content").text(enchaseMoney);
            return;
        }

        $("#submit").submit();

    };


</script>